<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Relatório</title>
    </h:head>
    
    <h:body>
        
    <h:form id="menuprincipal">
        
       <p:menubar>
       
           <p:submenu label="Cadastrar" icon="ui-icon-document">  
             <p:menuitem value="Candidatos" icon="ui-icon-document" url="/faces/cadastro_candidato.xhtml" ajax="true" />
             <p:menuitem value="Eleitores" icon="ui-icon-document" url="/faces/cadastro_eleitor.xhtml" ajax="true" />
          </p:submenu>
            
          <p:submenu label="Excluir" icon="ui-icon-close">  
             <p:menuitem value="Excluir Eleitores" url="/faces/exclui_eleitor.xhtml" icon="ui-icon-close" ajax="true" />
          </p:submenu>
  
          <p:submenu label="Editar" icon="ui-icon-pencil">  
             <p:menuitem value="Editar Candidatos" url="/faces/seleciona_candidato.xhtml" icon="ui-icon-pencil" ajax="false" />
          </p:submenu>
       
          <p:submenu label="Pesquisar" icon="ui-icon-search">
             <p:menuitem value="Pesquisar Eleitor" icon="ui-icon-search" url="/faces/pesquisa.xhtml" ajax="true" />
             <p:menuitem value="Exibir Todos" icon="ui-icon-search" url="/faces/relatorio.xhtml" ajax="true" />
          </p:submenu>
           
           <p:submenu label="Gráficos" icon="ui-icon-search">
               <p:menuitem value="Total de votos" icon="ui-icon-search" url="/faces/total_votos.xhtml" ajax="false" /> 
           </p:submenu>
  
          <p:submenu label="Ajuda" icon="ui-icon-help">  
              <p:menuitem value="Sobre o Sistema" icon="ui-icon-help" url="#" ajax="false" onclick="dialogo.show()" />
          </p:submenu>
           
       </p:menubar>
      
    </h:form> 
      
    <h:form prependId="false">
       
       <div id="buttonDiv" style=" padding: 2px 1px 2px 2px; background-color: royalblue">
       <p:commandButton value="Imprimir" type="button" icon="ui-icon-print">
          <p:printer target="eleitorTabela" />
       </p:commandButton>
       </div>
                      
        <p:dataTable id="eleitorTabela" var="e" value="#{eleitorC.lista}" emptyMessage="Nenhum eleitor cadastrado.">  
          <p:column>
              <f:facet name="header">
                  Nome
              </f:facet>
              <h:outputText value="#{e.nome}" />
          </p:column>
          <p:column>
              <f:facet name="header">
                 Sexo     
              </f:facet>
              <h:outputText value="#{e.sexo}" />
          </p:column>
          <p:column>
              <f:facet name="header">
                  Nascimento
              </f:facet>
              <h:outputText value="#{e.nascimento}">
                  <f:convertDateTime pattern="dd/MM/yyyy" />
              </h:outputText>
          </p:column>
          <p:column>
              <f:facet name="header">
                 CPF    
              </f:facet>
              <h:outputText value="#{e.cpf}" />
          </p:column>
          <p:column>
              <f:facet name="header">
                 Tel. Celular    
              </f:facet>
              <h:outputText value="#{e.telefone_celular}" />
          </p:column>
          <p:column>
              <f:facet name="header">
                  Título
              </f:facet>
              <h:outputText value="#{e.titulo}" />
          </p:column>
           <p:column>
              <f:facet name="header">
                  Zona
              </f:facet>
              <h:outputText value="#{e.zona}" />
          </p:column>
          <p:column>
              <f:facet name="header">
                  Seção
              </f:facet>
              <h:outputText value="#{e.secao}" />
          </p:column>
       </p:dataTable>
                    
    </h:form>
        
       <p:dialog id="modaldialogo" header="Sobre" widgetVar="dialogo" modal="true" height="100">
          <h:outputText value="Desenvolvido por Primatech Software Corporation - 2013" />
       </p:dialog>
        
       <div id="sobre" style="width: 100%; height: 25px; text-align: center; font-size: 15px; font-weight: bold; background: limegreen; color: black; margin-top: 500px">
          <p style="padding-top: 3px">DESENVOLVIDO POR PRIMATECH SOFTWARE CORPORATION - 2013</p>
       </div>    
                
    </h:body>
    
</html>
